package com.api.projectY.controller;

import com.api.common.core.domain.AjaxResult;
import com.api.core.domain.vo.tracing.serialization.SerializationVo;
import com.api.core.domain.vo.tree.TreeVo;
import com.api.core.service.ISerializationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/serialization")
public class SerializationController {

    @Autowired
    ISerializationService serializationService;

    @PostMapping("/generates")
    public AjaxResult generates(@RequestBody TreeVo vo) {
        return AjaxResult.success(serializationService.generates(vo));
    }

    @PostMapping("/score")
    public AjaxResult scroe(@RequestBody SerializationVo vo) {
        return AjaxResult.success(serializationService.scroe(vo));
    }
}
